<!doctype html>
<html lang="zh">
<head>
    {block name="tpl_vars"}{/block}
    {include file="admin@public/head" /}
</head>

<body class="hold-transition skin-blue sidebar-mini {$_page_name}">

    <div class="wrapper">
        {block name="wrapper"}

            <header class="main-header">
                <a href="{:url('admin/index/index')}" class="logo">
                    <!-- mini logo for sidebar mini 50x50 pixels -->
                    <span class="logo-mini">{:config('WEB_SITE_TITLE')}</span>
                    <!-- logo for regular state and mobile devices -->
                    <span class="logo-lg">{:config('WEB_SITE_TITLE')}</span>
                </a>

                <nav class="navbar navbar-static-top" role="navigation">
                    <div class="collapse navbar-collapse pull-left">
                        <ul class="nav navbar-nav">
                            {volist name="_admin_menu" id="vo"}
                                <li <?php if($vo['_active']) echo 'class="active"'; ?>>
                                    <a href="{:url($vo._url)}">
                                        <i class="fa {$vo.icon}"></i>
                                        <span>{$vo.title}</span>
                                    </a>
                                </li>
                            {/volist}
                        </ul>
                    </div>

                    <div class="navbar-custom-menu">
                        <ul class="nav navbar-nav pull-right">
                            <li><a href="{:url('admin/system/remove_runtime')}" style="border: 0;text-align: left" class="btn ajax-get b-r-0 no-refresh"><i class="fa fa-trash"></i> 清空缓存</a></li>
                            <li><a target="_blank" href="__ROOT__/"><i class="fa fa-external-link"></i> 打开前台</a></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-user"></i>&nbsp;
                                    <span>{$_user_auth.nickname}</span>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a target="_blank" href="__ROOT__/"><i class="fa fa-external-link"></i> 打开前台</a></li>
                                    <li><a href="{:url('admin/index/removeRuntime')}" style="border: 0;text-align: left;" class="btn text-left ajax-get no-refresh"><i class="fa fa-trash"></i> 清空缓存</a></li>
                                    <li><a href="{:url('admin/logout/index')}" class="ajax-post"><i class="fa fa-sign-out"></i> 退出后台</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </nav>
            </header>

            <aside class="main-sidebar">
                <?php if (!request()->isMobile()): ?>
                    <section class="sidebar">
                        <?php if ($_module_menu && $_module_menu['_children']): ?>
                            <ul class="sidebar-menu" data-widget="tree" data-accordion="false">
                                {volist name="_module_menu._children" id="_ns_first" key="fkey"}
                                    <li <?php if($_ns_first['_children']) echo 'class="treeview menu-open"'; ?>>
                                        <a href="#">
                                            <i class="{$_ns_first.icon}"></i>
                                            <span>{$_ns_first.title}</span>
                                            <?php if ($_ns_first['_children']): ?>
                                                <span class="pull-right-container">
                                                    <i class="fa fa-angle-left pull-right"></i>
                                                </span>
                                            <?php endif; ?>
                                        </a>
                                        {notempty name="_ns_first._children"}
                                             <ul class="treeview-menu" style="display:block;">
                                                 {volist name="_ns_first._children" id="_ns_second" key="skey"}
                                                     <li <?php if($_ns_second['_active']) echo 'class="active"'; ?>>
                                                         <a href="{:url($_ns_second.url)}" >
                                                             <i class="{$_ns_second.icon}"></i>
                                                             <span>{$_ns_second.title}</span>
                                                         </a>
                                                     </li>
                                                 {/volist}
                                             </ul>
                                         {/notempty}
                                     </li>
                                {/volist}
                            </ul>
                        <?php endif; ?>
                    </section>
                <?php endif; ?>
            </aside>


            <div class="content-wrapper">
                    <div class="page-bar">
                        <?php if ($_breadcrumbs): ?>
                            <ul class="page-breadcrumb">
                                <li><i class="fa fa-map-marker"></i></li>
                                {volist name="_breadcrumbs" id="vo"}
                                    <li>{$vo}</li>
                                {/volist}
                            </ul>
                        <?php endif; ?>
                    </div>
                    
                    {block name="full-content"}
                        {notempty name="page_title"}
                            <section class="content-header">
                                <h1>{$page_title}</h1>
                            </section>
                        {/notempty}

                        <section class="content">
                            {include file="admin@public/flash_message"}
                    
                            {block name="content-section"}
                                <div class="row">
                                    <div class='col-xs-12'>
                                        {block name="main-content"}{/block}
                                    </div>
                                </div>
                            {/block}
                        </section>
                    {/block}
            </div>

        {/block}
    </div>

</body>
</html>